var t = getApp();

Component({
    properties: {
        DataInfo: {
            type: null
        },
        isType: {
            type: Boolean
        }
    },
    data: {
        levelsList: [],
        discount_value: {},
        level_discount_type: !0,
        discount_method: "1"
    },
    lifetimes: {
        attached: function() {},
        ready: function() {
            this.properties.isType && this.getDataInfo();
        },
        moved: function() {},
        detached: function() {}
    },
    attached: function() {},
    ready: function() {},
    pageLifetimes: {
        show: function() {},
        hide: function() {},
        resize: function() {}
    },
    methods: {
        getDataInfo: function() {
            var e = this, s = t.getNetAddresss("plugin.store-cashier.frontend.store.goods.get-store-goods-setting");
            if (t._postNetWork({
                url: s,
                success: function(t) {
                    var s = t.data;
                    1 == s.result ? e.setData({
                        levelsList: s.data.member_level
                    }) : wx.showToast({
                        icon: "none",
                        title: s.msg,
                        duration: 1500
                    });
                },
                fail: function(t) {
                    console.log(t.msg);
                }
            }), this.properties.isType) ; else if (t._isTextEmpty(this.data.DataInfo)) console.log("刚刚开启"); else {
                var i = Boolean(this.data.DataInfo.discount.level_discount_type);
                try {
                    var a = this.data.DataInfo.discount.discount_method.toString();
                } catch (t) {
                    console.log(t);
                }
                var o = this.data.DataInfo.discount.discount_value;
                this.setData({
                    discount_method: a,
                    level_discount_type: i,
                    discount_value: o
                });
            }
        },
        DiscountJson: function() {
            var t;
            t = {
                level_discount_type: this.data.level_discount_type ? 1 : 0,
                discount_method: "1" == this.data.discount_method ? 1 : 2,
                discount_value: this.data.discount_value
            }, this.triggerEvent("getChildthreeData", t, {
                bubbles: !1
            }), this.triggerEvent("getSignthree", this.data.levelsList.length, {
                bubbles: !1
            });
        },
        onChange: function(t) {
            var e = t.target.dataset.id || t.currentTarget.dataset.id, s = this.data.discount_value;
            s[e] = t.detail.value, this.setData({
                discount_value: s
            });
        },
        onChangeRadio: function(t) {
            this.setData({
                discount_method: t.detail
            });
        },
        checkAll: function(t) {
            this.setData({
                level_discount_type: t.detail
            });
        }
    }
});